package com.aizuda.boot.modules.enums;

import com.aizuda.boot.modules.common.constant.enums.DepartmentRule;
import com.aizuda.boot.modules.business.contractNumber.service.ContractNumberRuleService;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author sangyirong
 * @ClassName EnumMsg
 * @Version 1.0
 * @Date 2025/7/7 16:14
 */
@SpringBootTest
public class EnumMsg {

    @Resource
    private ContractNumberRuleService contractNumberRuleService;


    @Test
    void getMsg(){
        DepartmentRule[] values = DepartmentRule.values();
        List<HashMap<String, String>> collect = Arrays.stream(values).map(item -> {
            HashMap<String, String> map = new HashMap<>();
            map.put("key", item.getCode());
            map.put("value", item.getMsg());
            return map;
        }).collect(Collectors.toList());
        System.out.println(collect);
    }
}
